<?php
/* ========== ########## ========== ########## ========== ########## ========== */
/*                                                                              */
/*   WHMCS v4.1.2 NULLED R4 by FLIPMODE  [ BAD SYNTAX ]                         */
/*                                                                              */
/*                             INTERNAL BAD SYNTAX NULLED VERSION: 2.5.9.6 R4   */
/*                                                                              */
/*   ALL files have been analysed, cleaned and nulled of:                       */
/*     - Call Backs  (100%)                                                     */
/*     - Link Backs (95%)                                                       */
/*     - Licensing  (100%)                                                      */
/*     - Remote Links + URL's                                                   */
/*                                                                              */
/*   WHMCS v4.1.2 RELEASED: 4th November 2009                                   */
/*    -> FIRST v4.1.2 NULL R1: 19th November 2009                               */
/*    -> UPDATED v4.1.2 NULL R4: 27th November 2009                             */
/*                                                                              */
/*   TESTING + VERIFICATION::                                                   */
/*     Files Cleaned, Nulled, Checked, Verified By:                             */
/*      -> FLIPMODE!                                                            */
/*     Decoded By:                                                              */
/*      -> FLIPMODE! + Unknown Decoder                                          */
/*     Tested By:                                                               */
/*      -> FLIPMODE!, LeetWolf, and 12 Anonymous Users...                       */
/*     WHMCS 4.1.2 Supplied By:                                                 */
/*      -> WHM CompleteShit Coder @ WHMCS.com                                   */
/*                                                                              */
/*                                                                              */
/*   IMPORTANT NOTE::                                                           */
/*   PLEASE NOTE THIS IS FOR TRIAL PURPOSES ONLY!                               */
/*                          LIKE IT? THEN BUY IT!                               */
/*                                                                              */
/* ========== ########## ========== ########## ========== ########## ========== */


require '../dbconnect.php';
require '../includes/functions.php';
require '../includes/adminfunctions.php';
$aInt = new adminInterface ('Configure General Settings');
$aInt->title = 'Support Request';
$aInt->sidebar = 'help';
$aInt->icon = 'support';
ob_start ();
if ($action == 'send')
{
	if ($name == '')
	{
		$errormessage .= 'You must enter your name, ';
	}

	if ($email == '')
	{
		$errormessage .= 'You must enter your email address, ';
	}

	if ($subject == '')
	{
		$errormessage .= 'You must enter a subject, ';
	}

	if ($message == '')
	{
		$errormessage .= 'You must enter a message, ';
	}

	if ($errormessage == '')
	{
		$mail = new PHPMailer ();
		$mail->From = $email;
		$mail->FromName = $name;
		$mail->Subject = $subject;
		$mail->CharSet = $CONFIG['Charset'];
		if ($CONFIG['MailType'] == 'mail')
		{
			$mail->Mailer = 'mail';
		}
		else
		{
			if ($CONFIG['MailType'] == 'smtp')
			{
				$mail->IsSMTP ();
				$mail->Host = $CONFIG['SMTPHost'];
				$mail->SMTPAuth = true;
				$mail->Port = $CONFIG['SMTPPort'];
				$mail->Username = $CONFIG['SMTPUsername'];
				$mail->Password = $CONFIG['SMTPPassword'];
				$mail->Sender = $email;
			}
		}

		$mail->Body = $message;
		$mail->AddAddress ($department);
		$mail->Send ();
		$mail->ClearAddresses ();
		infobox ('Submission Success', 'Your email has been sent. You will receive a confirmation by email when a ticket is successfully opened.');
		echo $infobox;
		$sent = 'true';
	}
	else
	{
		infobox ('Submission Error', $errormessage);
		echo $infobox;
	}
}

if ($sent != 'true')
{
	if ($errormessage == '')
	{
		$name = $CONFIG['CompanyName'];
		$email = $CONFIG['Email'];
		$message = 'Enter your message here...

### DEBUG INFORMATION ###

Registered to: ' . $licensing->keydata['registeredname'] . '
License Type: ' . $licensing->keydata['productname'] . '
License Key: ' . $license . '
License Expires: ' . $licensing->keydata['nextduedate'] . '
WHMCS URL: ' . $CONFIG['SystemURL'] . '
WHMCS Version: ' . $CONFIG['Version'] . '
PHP Version: ' . phpversion () . '
MySQL Version: ' . mysql_get_server_info ();
	}

	echo '
<form method="post" action="';
	echo $PHP_SELF;
	echo '?action=send">

<table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td class="fieldlabel">Your Name</td><td width=5></td><td class="fieldarea"><input type="text" name="name" size="40" value="';
	echo $name;
	echo '"></td></tr>
<tr><td class="fieldlabel">Your Email</td><td></td><td class="fieldarea"><input type="text" name="email" size="60" value="';
	echo $email;
	echo '"></td></tr>
<tr><td class="fieldlabel">Department</td><td></td><td class="fieldarea">';
	echo '<s';
	echo 'elect name="department"><option value="noreply@yagbu.net">Support<option value="noreply@yagbu.net">Sales<option value="noreply@yagbu.net">Licensing</select></td></tr>
<tr><td class="fieldlabel">Subject</td><td></td><td class="fieldarea"><input type="text" name="subject" size="80" value="';
	echo $subject;
	echo '"></td></tr>
</table>

<br />

<textarea rows="20" name="message" style="width:100%;">';
	echo $message;
	echo '</textarea>

<p align=center><input type="submit" value="Send Request" class="button"> <input type="reset" value="Cancel" class="button"></p>

<p>* You may delete the debug information if you do not wish to send this information to us but it usually helps us assist you with your problem and reach a resolution more quickly.</p>

</form>

';
}

$content = ob_get_contents ();
ob_end_clean ();
$aInt->content = $content;
$aInt->display ();
?>